Ext.ns('EP.artists');

var lastfmRequestURL = 'http://ws.audioscrobbler.com/2.0/?method=event.getinfo';
var lastfmEventID = '&event=1748235';
var lastfmApiKey = '&api_key=754cbb196471148411fbc175b9f88e3c';
var lastfmRequestFormat = '&format=json';
var random = '&'  + Math.random();
var requestURL = lastfmRequestURL + lastfmEventID + lastfmApiKey + lastfmRequestFormat + random;

EP.artists.store = new Ext.data.ArrayStore({
	idProperty: 'artistname',
    fields : ['id','artistname']
});

var lineUpData = [
{id:0,artistname:'Interpol'},
{id:1,artistname:'The Chemical Brothers'},
{id:2,artistname:'Arcade Fire'},
{id:3,artistname:'PJ Harvey'},
{id:4,artistname:'DJ Shadow'},
{id:5,artistname:'Mogwai'},
{id:6,artistname:'Pulp'},
{id:7,artistname:'Beirut'},
{id:8,artistname:'White Lies'},
{id:9,artistname:'Sinéad OConnor'},
{id:10,artistname:'Lykke Li'},
{id:11,artistname:'Blonde Redhead'},
{id:12,artistname:'The Go! Team'},
{id:13,artistname:'The Rapture'},
{id:14,artistname:'The Walkmen'},
{id:15,artistname:'Public Enemy'},
{id:16,artistname:'Santigold'},
{id:17,artistname:'Orchestral Manoeuvres In The Dark'},
{id:18,artistname:'Boys Noize'},
{id:19,artistname:'The Drums'},
{id:20,artistname:'Jimmy Cliff'},
{id:21,artistname:'The Charlatans'},
{id:22,artistname:'The Pains of Being Pure at Heart'},
{id:23,artistname:'Trentemøller'},
{id:24,artistname:'Flying Lotus'},
{id:25,artistname:'Midlake'},
{id:26,artistname:'Killing Joke'},
{id:27,artistname:'Paul Kalkbrenner'},
{id:28,artistname:'The Undertones'},
{id:29,artistname:'Best Coast'},
{id:30,artistname:'James Blake'},
{id:31,artistname:'Willy Mason'},
{id:32,artistname:'Warpaint'},
{id:33,artistname:'Health'},
{id:34,artistname:'Twin Shadow'},
{id:35,artistname:'Micah P. Hinson'},
{id:36,artistname:'Zola Jesus'},
{id:37,artistname:'Dave Clarke'},
{id:38,artistname:'Big Audio Dynamite'},
{id:39,artistname:'Yuck'},
{id:40,artistname:'Gavin Friday'},
{id:41,artistname:'Mundy'},
{id:42,artistname:'Adam Beyer'},
{id:43,artistname:'The Potbelleez'},
{id:44,artistname:'Sharon Shannon'},
{id:45,artistname:'Adebisi Shank'},
{id:46,artistname:'Caitlin Rose'},
{id:47,artistname:'British India'},
{id:48,artistname:'Solar Bears'},
{id:49,artistname:'Joan As Policewoman'},
{id:50,artistname:'3epkano'},
{id:51,artistname:'The Cast of Cheers'},
{id:52,artistname:'Power of Dreams'},
{id:53,artistname:'Codes'},
{id:54,artistname:'O Emperor'},
{id:55,artistname:'angkorwat'},
{id:56,artistname:'R.S.A.G.'},
{id:57,artistname:'Catscars'},
{id:58,artistname:'The Family Stone'},
{id:59,artistname:'The Danger Is'},
{id:60,artistname:'Ivan St John'}
];

/*
Ext.util.JSONP.request({
		url : requestURL,
		noCache : false,
		callbackKey :'callback',
		callback : function(result){
			var fixedArray = [];
			Ext.each(result.event.artists.artist,function(artist,index){
				rec = new Array(index,artist);
				fixedArray[index] = rec;
				console.log(rec);
			});
			EP.artists.store.loadData(mydata);
			console.log(EP.artists.store.getCount());
		}
});
*/

EP.artists.store.loadData(lineUpData );

EP.artists.list = new Ext.List({ 
	title : 'Artists',
	itemTpl : '{artistname}',
	iconCls : 'favorites',
  //  grouped : true,
    indexBar: true,
	store: EP.artists.store
});


